package com.moneywelcome.atomloanfacade.api;

import com.moneywelcome.atomloanfacade.form.SaveLoanForm;
import com.moneywelcome.atomloanfacade.info.LoanInfo;
import com.moneywelcome.params.PageParam;
import com.moneywelcome.results.PageResult;
import com.moneywelcome.results.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(value = "atom-loan",contextId = "UserLoanApi")
public interface UserLoanApi {

    @PutMapping("loan")
    Result saveLoan(@RequestBody SaveLoanForm form);

    @PostMapping("loan/{userId}")
    Result<PageResult<LoanInfo>> getLoanByUser(@PathVariable("userId")Integer userId,@RequestBody PageParam param);

    @PostMapping("loans")
    Result<PageResult<LoanInfo>> getLoans(@RequestBody PageParam param);
}
